/*
 * @Author: zqx me_zqx@163.com
 * @Date: 2025-04-28 13:33:26
 * @LastEditors: zqx me_zqx@163.com
 * @LastEditTime: 2025-05-12 21:25:42
 * @FilePath: /XMate-h5/src/services/msgCenter/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { xmateHttp } from "../../utils/http";
import type { MsgPageParams, MsgPageResponse } from './type';

/**
 * 分页查询消息列表
 * @param params 查询参数
 * @returns 消息列表数据
 */
export const getMsgPage = (data: MsgPageParams) => {
  return xmateHttp.request({
    url: `/rest/api/msg/page`,
    method: "POST",
    data,
  });
};

/**
 * 获取消息详情
  * @param confId 会话ID
  * @returns 消息详情数据
  */
  export const getMsgDetail = (confId: string) => {
    return xmateHttp.request({
      url: `/rest/api/msg/detail/${confId}`,
      method: "POST"
    });
  };


export const disableMsgAPI = (confId: string) => {
  return xmateHttp.request({
    url: `/rest/api/msg/disable/${confId}/1`,
    method: "PUT"
  });
};

export const enableMsgAPI = (confId: string, status: number) => {
  return xmateHttp.request({
    url: `/rest/api/msg/disable/${confId}/0`,
    method: "PUT"
  });
};
